﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace CMS.Converts
{
    public class StringToint : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null) return 3;
            switch (value)
            {
                case "管理员": return 0; break;
                case "员工":
                    return 1; break;
                default: break;
            }
            return 3;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null) return 3;
            switch (value)
            {
                case "管理员": return 0; break;
                case "员工":
                    return 1; break;
                default: break;
            }
            return 3;
        }
    }
}
